﻿using Prism.Mvvm;
using Prism.Regions;

namespace ModuleViewD.ViewModels
{
    public class ViewDViewModel : BindableBase, INavigationAware
    {
        private string _message;
        public string Message
        {
            get { return _message; }
            set { SetProperty(ref _message, value); }
        }

        public ViewDViewModel()
        {
            Message = "View D from your Prism Module";
        }

        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            //接收参数
            if (navigationContext.Parameters.ContainsKey("Message"))
            {
                Message = navigationContext.Parameters["Message"].ToString();
            }
        }

        public bool IsNavigationTarget(NavigationContext navigationContext)
        {
            return true;
        }

        public void OnNavigatedFrom(NavigationContext navigationContext)
        {

        }
    }
}
